﻿Imports SdlDotNet.Graphics
Imports SdlDotNet.Graphics.Sprites
Imports System.Drawing

Public Class InventoryDisplayPanel
    Implements IControl

    Private SmallMissilesAndWarheadsText As TextSprite
    Private MediumMissilesAndWarheadsText As TextSprite
    Private LargeMissilesAndWarheadsText As TextSprite
    Private ExtraLargeMissilesAndWarheadsText As TextSprite
    Private AntiAircraftText As TextSprite
    Private AntiMissileText As TextSprite
    Private BomberText As TextSprite

    Public Sub New()
        Dim normalFont As SdlDotNet.Graphics.Font = FontFactory.BoldSmall()

        SmallMissilesAndWarheadsText = New TextSprite("", normalFont, Color.White, True, New Point(87, 8))
        MediumMissilesAndWarheadsText = New TextSprite("", normalFont, Color.White, True, New Point(152, 8))
        LargeMissilesAndWarheadsText = New TextSprite("", normalFont, Color.White, True, New Point(213, 8))
        ExtraLargeMissilesAndWarheadsText = New TextSprite("", normalFont, Color.White, True, New Point(287, 8))
        AntiAircraftText = New TextSprite("", normalFont, Color.White, True, New Point(774, 8))
        AntiMissileText = New TextSprite("", normalFont, Color.White, True, New Point(638, 8))
        BomberText = New TextSprite("", normalFont, Color.White, True, New Point(498, 8))
    End Sub

    Public Sub ShowInventory(ByVal inventoryToDisplay As Inventory)
        SmallMissilesAndWarheadsText.Text = inventoryToDisplay.SmallMissiles & "/" & inventoryToDisplay.SmallWarheads
        MediumMissilesAndWarheadsText.Text = inventoryToDisplay.MediumMissiles & "/" & inventoryToDisplay.MediumWarheads
        LargeMissilesAndWarheadsText.Text = inventoryToDisplay.LargeMissiles & "/" & inventoryToDisplay.LargeWarheads
        ExtraLargeMissilesAndWarheadsText.Text = inventoryToDisplay.ExtraLargeMissiles & "/" & inventoryToDisplay.ExtraLargeWarheads
        AntiAircraftText.Text = inventoryToDisplay.AntiAircraft.ToString()
        AntiMissileText.Text = inventoryToDisplay.AntiMissile.ToString()
        BomberText.Text = inventoryToDisplay.Bombers.ToString()
    End Sub

    Public Sub Draw(ByRef display As Surface) Implements IControl.Draw
        display.Blit(SmallMissilesAndWarheadsText)
        display.Blit(MediumMissilesAndWarheadsText)
        display.Blit(LargeMissilesAndWarheadsText)
        display.Blit(ExtraLargeMissilesAndWarheadsText)
        display.Blit(AntiAircraftText)
        display.Blit(AntiMissileText)
        display.Blit(BomberText)
    End Sub
End Class
